﻿using System.IO;

namespace Office.Spreadsheet.Formats.Biff
{
    struct RangeAddress8
    {
        private ushort firstRow;
        private ushort lastRow;
        private byte firstColumn;
        private byte lastColumn;

        public void Read(BinaryReader reader)
        {
            this.firstRow = reader.ReadUInt16();
            this.lastRow = reader.ReadUInt16();
            this.firstColumn = reader.ReadByte();
            this.lastColumn = reader.ReadByte();

        }
        public static explicit operator RangeAddress(RangeAddress8 ra)
        {
            return new RangeAddress(new CellAddress(ra.firstRow, ra.firstColumn), new CellAddress(ra.lastRow, ra.lastColumn));

        }
    }
}